package xyz.labmem.base.core.error

import cn.hutool.core.exceptions.ExceptionUtil
import xyz.labmem.base.core.consts.log

/**
 * @Author lty
 * @Date 2021/12/14 16:05
 */
class AppException(
    message: String?, e: Exception?
) : RuntimeException(message, e) {

    private val log = this.log()

    constructor(message: String?) : this(message, null)
    constructor (e: Exception) : this(e.message, e)

    init {
        log.error("===============报错信息 (FuncException)===============")
        log.error("message：$message")
        log.error(ExceptionUtil.getMessage(e))
        log.error("=====================ERROR  END=======================")
    }

}